Optimization method for a lean capable multi-mode engine

ABSTRACT

A method of generating a shift schedule and combustion mode schedule to optimize performance characteristics of a lean capable, multiple combustion mode engine with a time-variant after-treatment system is disclosed. The method comprises the steps of generating a lowest cost value for fuel economy and vehicle emissions as a function of an engine operating mode, wherein the engine operating mode is selected from a group consisting of a homogeneous stoichiometric mode, a homogeneous lean mode, and a stratified mode. The lowest cost value is stored in a shift schedule and combustion mode schedule along with the engine operating parameters that achieved the lowest cost value.

TECHNICAL FIELD

This invention relates to a method of optimizing performancecharacteristics of internal combustion engines and more particularly toa method of optimizing performance and fuel economy with emissionsconstraints in a lean capable engine that can operate in multiplecombustion modes having a time variant after-treatment system.

BACKGROUND

Manufacturers have been continuously improving the performance ofinternal combustion engines. In order to meet ever-increasing standardsfor fuel economy and vehicle emissions, however, manufacturers have beenforced to consider new methods for increasing fuel economy and reducingundesirable fuel emissions. One improvement being considered is a leancapable engine, such as a direct injection engine, that can operate inmultiple combustion modes.

Conventional internal combustion engines use fuel injectors to preciselycontrol the amount of fuel inducted into the engine's cylinders. Also,fuel injectors atomize the liquid fuel, increasing the homogeneity ofthe air and fuel mixture. In conventional internal combustion engines,this air and fuel is mixed prior to entering the combustion chamber.

In contrast, in a direct injection engine, fuel and air mix in thecombustion chamber itself. The primary benefit of this is that the fuelburns more thoroughly, and correspondingly delivers more power and fueleconomy as compared to a conventional internal combustion engine.

Lean capable, multiple combustion mode engines, such as a directinjection engine, can provide power in three basic combustion modes,those being homogeneous stoichiometric, homogeneous lean, andstratified.

The homogeneous stoichiometric mode can be used under almost anyoperating condition. During homogeneous stoichiometric operation, theengine operates at an air/fuel ratio (AFR) near stoichiometry orapproximately 14.6:1.

The homogeneous lean mode, on the other hand, is desirable only atmoderate engine loads. During homogeneous lean operation, the engineoperates at an AFR of approximately 18:1 to 25:1. As the engine loadincreases, however, the homogeneous lean mode is limited by the engine'sability to produce torque. In addition, at the lower end of engineloads, the homogeneous lean mode is limited by combustion stability.

The stratified mode is desirable only at lower engine speeds and torqueoperating points. High load operation may result in undesirablehydrocarbon (HC) and smoke emissions. Unlike the homogeneous lean mode,however, the stratified mode can be used at very low engine loads,including idle. Stratified operation is characterized by an overall AFRbetween approximately 25:1 and 40:1.

These various combustion modes have an effect on the exhaust gasemissions of lean capable, multiple combustion mode engines. Typically,an additional three-way catalyst is positioned downstream of a firstthree-way catalyst. The additional catalyst, sometimes referred to as alean NO_(x), trap (LNT) is periodically purged by operating the engineat a rich air/fuel ratio to release and reduce stored NO_(x). This isreferred to as a time-variant after-treatment system because the LNTefficiency, and hence, the efficiency of the after-treatment system,changes with time as the LNT fills with NO_(x).

Thus, there exists a need for optimized mode scheduling to minimize fuelconsumption and minimize exhaust gas emissions for lean capable,multiple combustion mode engines having a time-variant after-treatmentsystem.

SUMMARY OF THE INVENTION

It is an object of the present invention to provide an optimizationmethodology to determine the optimum transmission gear, combustion mode,air/fuel ratio (AFR), spark advance, and amount of exhaust gasrecirculation (EGR) for emissions-constrained lean capable, multiplecombustion mode engines having a time-variant after-treatment system.

The above and other objects and advantages are achieved by providing amethod of determining a desired transmission gear, combustion mode, AFR,spark advance, and EGR rate for all of the possible engine speed andwheel torque values. The method comprises the steps of, starting at thevehicle level, determining the range of speeds and wheel torques. A costvalue, which is a function of fuel economy and emissions, is theninitialized at a large value for spark advance, EGR, AFR, combustionmode, and transmission gear (respectively Jspark, Jegr, Jafr, Jmode, andJgear). For each combustion mode (homogeneous stoichiometric,homogeneous lean, or stratified) at each transmission gear, the AFR, EGRand spark advance are varied to minimize the cost values associated withfuel flow and emissions with respect to target values. A cost value forthe evaluation (Jeval) is calculated using a Lagrangian weightingfactor. The resulting values are considered a local minimum. Arepetitive process of comparing the various cost values to one another(i.e. Jeval to Jspark, Jspark to Jegr), adjusting cost values ifnecessary and recalculating Jeval, is begun and continues until suchtime as a global solution is achieved. The global solution is defined asthe optimum fuel economy and emissions in terms of cost value (Jfinal)for each vehicle speed and wheel torque at each point of an operatingparameter grid (transmission gear, spark advance, AFR, EGR, andcombustion mode).

This process accounts for the time-varying after-treatment system bydetermining the amount of time the engine can spend in lean orstratified operation, and a LNT purge time by calculating a weightedaverage of the emissions from the lean or stratified mode and purgeoperation. By assuming a steady-state operation at each speed-loadpoint, and by applying the same Lagrangian weighting factor for allvehicle operation modes, the optimization method, which is not cyclespecific, provides calibrations with no defeat device likecharacteristics.

Other objects and advantages of the present invention will becomeapparent upon considering the following detailed description andappended claims, and upon reference to the accompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a logic flow diagram of one embodiment of the optimizationprocess of the present invention;

FIGS. 2a, 2 b are a detailed logic flow diagram of a portion of FIG. 1;

FIGS. 3a, 3 b are a logic flow diagram for the lean stratifiedsubroutine of FIGS. 2a, 2 b;

FIG. 4 is a logic flow diagram for the compare modes subroutine of FIGS.3a, 3 b;

FIG. 5 is a logic flow diagram for the check gear subroutine of FIG. 4;and

FIG. 6 is a logic flow diagram of a portion of FIGS. 3a, 3 b.

DESCRIPTION OF THE PREFERRED EMBODIMENT(S)

FIG. 1 shows a flow chart for determining the optimum fuel economy andemissions characteristics where vehicle speed and wheel torque areknown.

Referring to FIG. 1, in Step 10, an initial vehicle speed and an initialwheel torque are determined. In Step 20, an initial transmission gear isset that can accommodate the vehicle speed and wheel torque desired asknown in the art. Then, in Step 30, a combustion mode for thatparticular transmission gear is selected. The combustion mode for a leancapable, multiple combustion mode engine may either be homogeneousstoichiometric (Step 40), homogeneous lean (Step 50) or stratified (Step60).

Throughout the description, the term “cost” is used to refer to the fuelrate and level of emissions for particular engine parameters. The lowest“cost” value for each variable represents the ideal or preferred fuelingrate and exhaust gas emission level for the particular engine parametersunder consideration. A higher relative cost value would representdegraded performance from either a fuel or emissions point of view. Ofcourse, however, the “lowest cost” value is a relative term which mustbe balanced between fuel and emissions as the lowest possible fuelingrate may not correlate to the lowest emissions levels and vice versa.The actual target lowest cost value is, therefore, a design choice.

In Step 45, a lowest cost value for the homogeneous stoichiometric mode,hereinafter referred to as the lowest homogeneous stoichiometric modecost value is determined by setting the AFR to stoichiometric andsweeping all of the possible spark advance values and EGR values.

In Step 55, a lowest cost value for the homogeneous lean mode,hereinafter referred to as the lowest homogeneous lean mode cost valueis determined by sweeping all of the possible spark advance values, EGRvalues, and AFR values. In this process, the LNT purge mode that takesplace in this engine-operating mode is also accounted for.

In Step 65, a lowest cost value for the stratified mode, hereinafterreferred to as the lowest stratified mode cost value determined bysweeping all of the possible spark advance values, EGR values, and AFRvalues. In this process, the LNT purge mode that takes place in thisengine-operating mode is also accounted for.

In Step 80, a determination is made if there is another transmissiongear available to increment to that has not yet been selected, and ifthere is Step 85 determines whether this transmission gear is acceptableat the current wheel torque and vehicle speed. If the answer is no ineither Step 80 or 85, the process continues to Step 90. If the answer isyes in Steps 80 and 85, proceed back to Step 20.

In Step 90, the lowest cost values determined in Steps 45, 55 and 65 arecompared, and a final cost value (Jfinal) is determined by settingJfinal equal to the lowest cost value of Steps 45, 55 and 65 taking intoaccount all of the potential transmission gear values.

Finally, in Step 95, the values for AFR, EGR, spark advance,transmission gear, and combustion mode are stored in a table. The tableis then expanded to include all of the potential vehicle speeds andwheel torques.

Referring to FIG. 2, in Step 100, cost weighting factors (Lagrangianmultipliers) are chosen for HC, CO and NO_(x) emissions that areexpected to result in desired tailpipe emissions for a particularemission cycle. Next, a first vehicle speed and a first wheel torquevalue are selected in Steps 110 and 140, respectively, from apredetermined table of vehicle speed and wheel torque values thatrepresent the expected range of vehicle operation. The optimum costvalue (Jfinal) for this vehicle speed and wheel torque is initially setto a large value in Step 140.

In Step 180, a first transmission gear is selected and the cost valuefor this transmission gear (Jgear) is initially set to a large value. Instep 200, the engine speed and required engine output torque arecalculated by known methods based on this first transmission gear fromthe vehicle speed and wheel torque, plus any expected torque anddrivetrain losses. Step 205 determines whether the engine speedcalculated in Step 200 is outside of predetermined acceptable values asknown in the art, and if it is, a new transmission gear is selected inStep 190 and the process reverts back to Step 200.

If the engine speed is within acceptable values, Step 220 is initiated,whereby a combustion mode and initial cost values for all possiblecombustion modes (Jstoich, Jlean, and Jstrat) are selected. Step 240determines whether the combustion mode selected in Step 220 wasstoichiometric. If the combustion mode was not stoichiometric, go tostep 250, which is the lean/stratified subroutine of FIG. 3. Otherwise,Step 260 sets AFR at stoichiometry and Step 270 selects an initial valuefor EGR and for the cost value of EGR (Jegr). Step 290 then selects aninitial spark advance and an initial cost value for spark advance(Jspark), and in Step 320 values for fuel flow and tailpipe emissionsare determined from models and regressions that describe the behavior ofan engine and catalyst system at the respective operating parameters(spark advance, EGR, engine speed, engine torque, and AFR). A cost value(Jeval_hom) for operating the system based upon these respectiveoperating parameters is then determined.

In Step 370, it is determined whether the current cost value (Jeval_hom)is at a minimum for this particular spark advance. Step 370 compares theJeval_hom determined in Step 350 with the Jspark set in Step 290. IfJeval_hom is larger than Jspark, the minimum value in the spark advancehas been passed, the spark loop is terminated, and the process continuesto Step 360. If Jeval_hom is less than Jspark, then Jspark is updated tothis lower cost value(equal to Jeval) and the spark advance value thatresulted in this cost value is stored in Step 380.

In Step 340, it is determined whether the current value of spark advancehas reached the limit of acceptable spark advances for the current levelof EGR at the current engine speed and engine torque. If the limit hasbeen reached, the spark loop is terminated by moving to Step 360.Otherwise, the spark advance value is incremented in Step 300 and a newevaluation of this new value of spark advance is started in Step 320.

When Step 360 is reached, the Jspark is compared to Jegr, and if Jsparkis greater than Jegr, the minimum point in the EGR sweep has been passedand the EGR sweep is terminated by going to Step 230. If Jspark is lessthan Jegr, then Jegr is updated to the lower cost value (equal toJspark) and saved along with the current EGR and spark advance values inStep 330. Also, in Step 330, the cost value for the current combustionmode Jstoich is set equal to Jegr. Then, in Step 310, it is determinedwhether the maximum value for EGR for this particular engine speed andwheel torque has been reached. If it has, the EGR loop is terminated bygoing to Step 230, otherwise the value of EGR in Step 280 is incrementedand another spark advance loop is initiated at this new level of EGRstarting in Step 290.

At the termination of the homogeneous stoichiometric mode, the sparkadvance, EGR, Jspark, Jegr, and Jstoich have been determined thatresults in the lowest cost value for the homogeneous stoichiometriccombustion mode. Step 230 then directs the process to select anothermode (either stratified or homogeneous lean) and proceed to Step 250.

FIG. 3 shows the logic diagram for the lean stratified subroutine ofFIG. 2. Referring to FIG. 3, Step 392 determines whether the currentcombustion mode is capable of operating at the current wheel torque andvehicle speed and transmission gear, if it is the logic proceeds to Step430, else the logic proceeds to Step 394. Step 394 determines whetherthe combustion mode is homogeneous lean or stratified, if it ishomogeneous lean go to Step 230 and select another mode (fromhomogeneous lean to stratified) and again proceed to Step 390. If Step394 determines that it is in stratified mode proceed to the comparemodes subroutine of FIG. 4, which is described below.

When evaluating the cost for the lean homogeneous and stratifiedcombustion modes, the determination of the fuel consumption andemissions is complicated by the fact that the efficiency of the leanNO_(x), trap (LNT) varies as a function of NO_(x), levels, thusaffecting fuel consumption and emissions. In addition, fuel consumptionand emissions also varies as a function of the NO_(x) purging cycle.Thus, a determination is made in Step 430 to define the desired AFR andEGR for the NO_(x) purging cycle. Then, an optimum spark advance isdetermined in Step 440 in a similar manner as was described in Steps290, 320, 350, 370, 380, 340, 300, 360, and 330 above. When a NO_(x)purge cycle is initiated, it is first necessary to deplete the storedoxygen in any catalyst upstream of the LNT. Since the emissions outputtime required for this portion of the purge cycle depends only on thepurge calibration, Step 470 determines the values for tailpipe emissionsand the time required to start the LNT purge to use in Step 580 below.

In Step 500, a starting value for AFR is determined for the currentcombustion mode (homogeneous lean or stratified). Alternatively,manifold pressure or air change may be substituted for AFR in thestratified mode A Jafr (or correspondingly a Jmanifold) will be selectedfor the AFR (or manifold pressure) sweep. Similar to the steps describedabove, initial values for EGR, spark advance, Jegr, and Jspark are setin Steps 530 and 560.

Steps 610, 620, 600, 570, 630, 590, 550 and 540 are also similar toSteps 370, 380, 340, 300, 360, 330, 310 and 280 as described above. Theprinciple difference is that a LNT purge activation threshold (PAT) isdetermined in Step 590 and is stored along with the spark advance andEGR values. Step 520 then determines if the Jafr (or Jmanifold) at thecurrent AFR (or manifold) is lower than the Jegr. If Jafr is lower thanJegr, the values for spark advance, PAT, EGR, and Jafr are saved in Step490 and the process proceeds to Step 480. If Jafr is not lower thanJegr, the logic proceeds directly to Step 480. In Step 480, if the AFR(or manifold pressure) limits are reached for this combustion mode, Step450 determines whether the combustion mode is homogeneous lean orstratified, and the values for spark advance, PAT, EGR AFR and eitherJlean (set equal to Jafr) or Jstrat (set equal to Jafr) are saved ineither Step 400 or Step 410, respectively.

From Step 400, the process restarts for a stratified mode in Step 210,where the combustion mode is set to stratified in the next mode step(Step 230) and the process proceeds to Step 240 and loops again. FromStep 410, the process moves to the compare modes step (Step 640) to bediscussed below with reference to FIG. 4.

If the AFR (or manifold pressure) limits have not been reached, the AFRis then incremented in Step 510 and the process returns to Step 530 tocontinue looping through the AFR/manifold pressure loop.

FIG. 4 shows the logic diagram for the compare modes subroutine of FIG.3. In FIG. 4, Step 640 compares the cost values of Jstoich, Jlean andJstrat (Steps 650, 660, and 680). If Jstoic is determined to be thelowest cost value, then Step 700 sets Jgear equal to Jstoic and savesvalues for the spark advance, EGR, and AFR. PAT is set equal to 1.0 inStep 700 as well since a NO_(x) purge step is not performed in thehomogeneous stoichiometric combustion mode. If Jstrat is determined tobe the lowest cost value, then Step 690 sets Jgear equal to Jstrat andsaves the associated values for spark advance, PAT, EGR, and AFR. IfJlean is the lowest cost value, then Step 670 sets Jgear equal to Jleanand saves the associated values for spark advance, PAT, EGR and AFR.From Steps 700, 690 or 670, the process proceeds to Step 710, the checkgears subroutine of FIG. 5.

FIG. 5 shows the logic diagram of the check gears subroutine of FIG. 4.In FIG. 5, Step 730 proceeds via Step 710 and determines whether Jgearis less than Jfinal. If Jgear is less than Jfinal, set Jfinal equal toJgear and store the values for spark advance and transmission gear inStep 740 and proceed to Step 750. If Jgear is not less than Jfinal,proceed to Step 750, where there is a determination whether to tryanother transmission gear. If the current transmission gear is the lasttransmission gear, Step 760 saves all of the optimum values fortransmission gear, combustion mode, AFR, EGR, spark advance and PAT forthis particular vehicle speed and engine torque.

Having completed the evaluation for one combination of vehicle speed andwheel torque values, the wheel torque is incremented and the processrestarts at Step 790 and 150. After evaluating all of the possible wheeltorques at one vehicle speed, the vehicle speed is then incremented andthe process restarts at Steps 810 and 130.

Finally, after it is determined in Step 810 that all of the possiblevehicle speeds have been swept, in step 800, the optimal fuel economyand emissions cost values for each speed/load point, along with the timespent at each of the points along a particular emissions cycle, are usedto determine an estimate of tailpipe emissions and fuel economy for thecycle.

If necessary, the results of Step 800 can be compared with knownemissions standards and the Lagrangian cost values set in Step 100 canbe modified and the program re-run to modify the optimal settingsachieved.

FIG. 6 shows the logic diagram of a portion of the logic of FIG. 3.Referring now to FIG. 6, the values from Step 580 of FIG. 3 are used tocalculate the engine out emissions and fuel flow in Step 905 during leanor stratified operation. In Step 910, initial values are set for PAT andJpat, which represents the cost value for the purge activationthreshold. Based on the information in Step 910 and catalyst behaviorknown in the art, the average tailpipe emissions and time spent fillingthe catalysts with oxygen during the lean or stratified operation isdetermined in Step 915. In Step 935, the average tailpipe emissions andtime spent while the NO_(x) trap is filled with NO_(x) to the PAT isdetermined. In Step 940, the average tailpipe emissions and time duringthe LNT purge is determined. Finally, in Step 945, the average tailpipeemissions and time spent during the fill/purge cycle is determined. Step950 averages the tailpipe emissions and fuel flow over the entirefill/purge cycle. The cost function, Jeval, is then determined in Step952 and compared to Jpat in Step 955 and, if Jeval is lower than Jpat,then Jpat is set to Jeval and the current PAT is save for futurereference in Step 960. The process continues to Step 930 where it isdetermined whether the limit of PAT is reached, and if so the loop isterminated and the output given to Step 580 described above. If thelimit of PAT is not reached, PAT is incremented in Step 920 and theprocess returns to Step 915. The values determined in Step 960 after thelast value of PAT is determined in Step 930 are then outputted for usein Step 580 listed above.

From the foregoing it will be seen that there has been brought to theart a new method of generating a shift schedule and combustion modeschedule for each vehicle speed, wheel torque and transmission gearassociated with a lean capable, multiple combustion mode engine, such asa direct injection engine, such that a cost value for fuel consumptionand emissions characteristics is optimized by generating a lowesttransmission gear cost value as a function of an engine operating modeand storing this value in a shift and combustion mode schedule. Thus,for every point on a vehicle speed and wheel torque grid for a leancapable, multiple combustion mode engine, the grid will predetermine theappropriate transmission gear, combustion mode, AFR, EGR, and sparkadvance to optimize emissions and fuel economy while accounting for atime variant after-treatment system.

While the invention has been described in terms of preferredembodiments, it will be understood, of course, that the invention is notlimited thereto since modifications may be made by those skilled in theart, particularly in light of the foregoing teachings.

What is claimed is:
 1. A method of generating a shift schedule andcombustion mode schedule for each vehicle speed and wheel torque valueassociated with a lean capable, multiple combustion mode engine, suchthat a cost value for fuel consumption and emissions characteristics isoptimized, said method comprising the steps of: (a) generating a lowestcost value as a function of an engine operating mode, wherein saidengine operating mode is selected from a group consisting of ahomogeneous stoichiometric mode, a homogeneous lean mode, and astratified mode; and (b) storing said lowest cost value in said shiftschedule and combustion mode schedule.
 2. The method of generating ashift schedule and combustion mode schedule according to claim 1,wherein the step of generating a lowest cost value comprises the stepof: (a) generating a lowest homogeneous stoichiometric mode cost value,a lowest homogeneous lean mode cost value, and a lowest stratified modecost value as a function of an engine operating parameter; and (b)setting said lowest cost value equal to the lowest of said lowesthomogeneous stoichiometric cost value, said lowest homogeneous mode costvalue, and said lowest stratified mode cost value.
 3. A method accordingto claim 2, where the method of setting said lowest cost value comprisesthe step of setting said lowest cost value, where said lowest costvalues represent a plurality of engine operating parameter values.
 4. Amethod according to claim 3, wherein the step of representing aplurality of engine operating parameter values comprises the step ofrepresenting a plurality of engine operating parameter values, wheresaid plurality of engine operating parameters consists of an EGR value,a spark advance value, a transmission gear value, and an AFR value.
 5. Amethod of generating a shift schedule and combustion mode schedule foreach vehicle speed, wheel torque and transmission gear value associatedwith a lean capable, multiple combustion mode engine, such that a costvalue for fuel consumption and emissions characteristics is optimized,said method comprising the steps of: (a) generating a lowesttransmission gear cost value as a function of an engine operating mode,wherein said engine operating mode is selected from a group consistingof a homogeneous stoichiometric mode, a homogeneous lean mode, and astratified mode; and (b) storing said lowest transmission gear costvalue in said shift schedule and combustion mode schedule.
 6. The methodof generating a shift schedule and combustion mode schedule according toclaim 5, wherein the step of generating a lowest transmission gear costvalue comprises the step of: (a) generating a lowest homogeneousstoichiometric mode cost value, a lowest homogeneous lean mode costvalue, and a lowest stratified mode cost value as a function of anengine operating parameter; and (b) setting said lowest transmissiongear cost value equal to the lowest of said lowest homogeneousstoichiometric cost value, said lowest homogeneous mode cost value, andsaid lowest stratified mode cost value.
 7. The method of claim 6,wherein the step of generating said lowest homogeneous stoichiometricmode cost value comprises the step of generating said lowest homogeneousstoichiometric mode cost value as a function of an exhaust gasrecirculation value and a spark advance value.
 8. The method of claim 7,wherein the step of generating a lowest homogeneous stoichiometric modecost value as a function of an exhaust gas recirculation value and aspark advance value comprises for each exhaust gas recirculation valueand spark advance value: (a) setting an initial exhaust gasrecirculation cost value and an initial spark advance cost value; (b)determining an evaluation cost value as a function of said exhaust gasrecirculation value and said spark advance value; (c) comparing saidevaluation cost value with said spark advance cost value; (d) settingsaid spark advance value equal to said evaluation cost value where saidevaluation cost value is lower than said spark advance value;incrementing said spark advance value as a function of said exhaust gasrecirculation value; and repeating steps (b) through (d); otherwise; (e)comparing said spark advance cost value with said exhaust gasrecirculation cost value; (f) setting said exhaust gas recirculationcost value equal to said spark advance cost value where said where saidspark advance cost value is lower than said exhaust gas recirculationcost value; incrementing said exhaust gas recirculation value as afunction of said homogeneous stoichiometric mode; and repeating steps(a) through (f); otherwise; (g) setting said lowest homogeneousstoichiometric mode cost value equal to said exhaust gas recirculationcost value.
 9. The method of claim 6, wherein the step of generatingsaid lowest homogeneous lean mode cost value comprises the step ofgenerating said lowest homogeneous lean mode cost value as a function ofan air fuel ratio value, an exhaust gas recirculation value and a sparkadvance value.
 10. The method of claim 9, wherein the step of generatinga lowest homogeneous lean mode cost value as a function of an air fuelratio value, an exhaust gas recirculation value and a spark advancevalue comprises for each air fuel ratio value, exhaust gas recirculationvalue and spark advance value: (a) setting an initial air fuel ratiovalue, an initial exhaust gas recirculation cost value and an initialspark advance cost value; (b) determining an evaluation cost value as afunction of said air fuel ratio value, said exhaust gas recirculationvalue and said spark advance value; (c) comparing said evaluation costvalue with said spark advance cost value; (d) setting said spark advancevalue equal to said evaluation cost value where said evaluation costvalue is lower than said spark advance value; incrementing said sparkadvance value as a function of said exhaust gas recirculation value; andrepeating steps (b) through (d); otherwise; (e) comparing said sparkadvance cost value with said exhaust gas recirculation cost value; (f)setting said exhaust gas recirculation cost value equal to said sparkadvance cost value where said where said spark advance cost value islower than said exhaust gas recirculation cost value; incrementing saidexhaust gas recirculation value as a function of said homogeneous leanmode; and repeating steps (a) through (f); otherwise; (g) comparing saidexhaust gas recirculating cost value with said air fuel ratio costvalue; (h) setting said air fuel ratio cost value equal to said exhaustgas recirculating cost value where said air fuel ratio cost value islower than said exhaust gas recirculating cost value; incrementing saidair fuel ratio value as a function of said homogeneous lean mode; andrepeating steps (a) through (h); otherwise; (i) setting said lowesthomogeneous lean mode cost value equal to said air fuel ratio costvalue.
 11. The method of claim 6, wherein the step of generating saidlowest homogeneous lean mode cost value comprises the step of generatingsaid lowest homogeneous lean mode cost value as a function of a manifoldpressure, an exhaust gas recirculation value and a spark advance value.12. The method of claim 11, wherein the step of generating a lowesthomogeneous lean mode cost value as a function of a manifold pressurevalue, an exhaust gas recirculation value and a spark advance valuecomprises for each manifold pressure value, exhaust gas recirculationvalue and spark advance value: (a) setting an initial manifold pressurevalue, an initial exhaust gas recirculation cost value and an initialspark advance cost value; (b) determining an evaluation cost value as afunction of said manifold pressure value, said exhaust gas recirculationvalue and said spark advance value; (c) comparing said evaluation costvalue with said spark advance cost value; (d) setting said spark advancevalue equal to said evaluation cost value where said evaluation costvalue is lower than said spark advance value; incrementing said sparkadvance value as a function of said exhaust gas recirculation value; andrepeating steps (b) through (d); otherwise; (e) comparing said sparkadvance cost value with said exhaust gas recirculation cost value; (f)setting said exhaust gas recirculation cost value equal to said sparkadvance cost value where said where said spark advance cost value islower than said exhaust gas recirculation cost value; incrementing saidexhaust gas recirculation value as a function of said homogeneous leanmode; and repeating steps (a) through (f); otherwise; (g) comparing saidexhaust gas recirculating cost value with said manifold pressure costvalue; (h) setting said manifold pressure cost value equal to saidexhaust gas recirculating cost value where said manifold pressure costvalue is lower than said exhaust gas recirculating cost value;incrementing said manifold pressure value as a function of saidhomogeneous lean mode; and repeating steps (a) through (h); otherwise;(i) setting said lowest homogeneous lean mode cost value equal to saidair fuel ratio cost value.
 13. The method of claim 6, wherein the stepof generating said lowest stratified mode cost value comprises the stepof generating said lowest stratified mode cost value as a function of anair fuel ratio value, an exhaust gas recirculation value and a sparkadvance value.
 14. The method of claim 13, wherein the step ofgenerating a lowest stratified mode cost value as a function of an airfuel ratio value, an exhaust gas recirculation value and a spark advancevalue comprises for each air fuel ratio value, exhaust gas recirculationvalue and spark advance value: (a) setting an initial air fuel ratiovalue, an initial exhaust gas recirculation cost value and an initialspark advance cost value; (b) determining an evaluation cost value as afunction of said air fuel ratio value, said exhaust gas recirculationvalue and said spark advance value; (c) comparing said evaluation costvalue with said spark advance cost value; (d) setting said spark advancevalue equal to said evaluation cost value where said evaluation costvalue is lower than said spark advance value; incrementing said sparkadvance value as a function of said exhaust gas recirculation value; andrepeating steps (b) through (d); otherwise; (e) comparing said sparkadvance cost value with said exhaust gas recirculation cost value; (f)setting said exhaust gas recirculation cost value equal to said sparkadvance cost value where said where said spark advance cost value islower than said exhaust gas recirculation cost value; incrementing saidexhaust gas recirculation value as a function of said stratified mode;and repeating steps (a) through (f); (g) comparing said exhaust gasrecirculating cost value with said air fuel ratio cost value; (h)setting said air fuel ratio cost value equal to said exhaust gasrecirculating cost value where said air fuel ratio cost value is lowerthan said exhaust gas recirculating cost value; incrementing said airfuel ratio value as a function of said stratified mode; and repeatingsteps (a) through (h); otherwise; (i) setting said lowest stratifiedmode cost value equal to said air fuel ratio cost value.